Left Termination of the query pattern
f_in_1(g)
w.r.t. the given Prolog program could successfully be proven:
↳ Prolog
↳ PrologToPiTRSProof
Clauses:
f(X) :- g(s(s(s(X)))).
f(s(X)) :- f(X).
g(s(s(s(s(X))))) :- f(X).
Queries:
f(g).
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
f_in: (b)
g_in: (b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
f_in_g(X) → U1_g(X, g_in_g(s(s(s(X)))))
g_in_g(s(s(s(s(X))))) → U3_g(X, f_in_g(X))
f_in_g(s(X)) → U2_g(X, f_in_g(X))
U2_g(X, f_out_g(X)) → f_out_g(s(X))
U3_g(X, f_out_g(X)) → g_out_g(s(s(s(s(X)))))
U1_g(X, g_out_g(s(s(s(X))))) → f_out_g(X)
The argument filtering Pi contains the following mapping:
f_in_g(x1) = f_in_g(x1)
U1_g(x1, x2) = U1_g(x2)
g_in_g(x1) = g_in_g(x1)
s(x1) = s(x1)
U3_g(x1, x2) = U3_g(x2)
U2_g(x1, x2) = U2_g(x2)
f_out_g(x1) = f_out_g
g_out_g(x1) = g_out_g
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
Pi-finite rewrite system:
The TRS R consists of the following rules:
f_in_g(X) → U1_g(X, g_in_g(s(s(s(X)))))
g_in_g(s(s(s(s(X))))) → U3_g(X, f_in_g(X))
f_in_g(s(X)) → U2_g(X, f_in_g(X))
U2_g(X, f_out_g(X)) → f_out_g(s(X))
U3_g(X, f_out_g(X)) → g_out_g(s(s(s(s(X)))))
U1_g(X, g_out_g(s(s(s(X))))) → f_out_g(X)
The argument filtering Pi contains the following mapping:
f_in_g(x1) = f_in_g(x1)
U1_g(x1, x2) = U1_g(x2)
g_in_g(x1) = g_in_g(x1)
s(x1) = s(x1)
U3_g(x1, x2) = U3_g(x2)
U2_g(x1, x2) = U2_g(x2)
f_out_g(x1) = f_out_g
g_out_g(x1) = g_out_g
Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:
F_IN_G(X) → U1_G(X, g_in_g(s(s(s(X)))))
F_IN_G(X) → G_IN_G(s(s(s(X))))
G_IN_G(s(s(s(s(X))))) → U3_G(X, f_in_g(X))
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → U2_G(X, f_in_g(X))
F_IN_G(s(X)) → F_IN_G(X)
The TRS R consists of the following rules:
f_in_g(X) → U1_g(X, g_in_g(s(s(s(X)))))
g_in_g(s(s(s(s(X))))) → U3_g(X, f_in_g(X))
f_in_g(s(X)) → U2_g(X, f_in_g(X))
U2_g(X, f_out_g(X)) → f_out_g(s(X))
U3_g(X, f_out_g(X)) → g_out_g(s(s(s(s(X)))))
U1_g(X, g_out_g(s(s(s(X))))) → f_out_g(X)
The argument filtering Pi contains the following mapping:
f_in_g(x1) = f_in_g(x1)
U1_g(x1, x2) = U1_g(x2)
g_in_g(x1) = g_in_g(x1)
s(x1) = s(x1)
U3_g(x1, x2) = U3_g(x2)
U2_g(x1, x2) = U2_g(x2)
f_out_g(x1) = f_out_g
g_out_g(x1) = g_out_g
U2_G(x1, x2) = U2_G(x2)
F_IN_G(x1) = F_IN_G(x1)
U1_G(x1, x2) = U1_G(x2)
U3_G(x1, x2) = U3_G(x2)
G_IN_G(x1) = G_IN_G(x1)
We have to consider all (P,R,Pi)-chains
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
Pi DP problem:
The TRS P consists of the following rules:
F_IN_G(X) → U1_G(X, g_in_g(s(s(s(X)))))
F_IN_G(X) → G_IN_G(s(s(s(X))))
G_IN_G(s(s(s(s(X))))) → U3_G(X, f_in_g(X))
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → U2_G(X, f_in_g(X))
F_IN_G(s(X)) → F_IN_G(X)
The TRS R consists of the following rules:
f_in_g(X) → U1_g(X, g_in_g(s(s(s(X)))))
g_in_g(s(s(s(s(X))))) → U3_g(X, f_in_g(X))
f_in_g(s(X)) → U2_g(X, f_in_g(X))
U2_g(X, f_out_g(X)) → f_out_g(s(X))
U3_g(X, f_out_g(X)) → g_out_g(s(s(s(s(X)))))
U1_g(X, g_out_g(s(s(s(X))))) → f_out_g(X)
The argument filtering Pi contains the following mapping:
f_in_g(x1) = f_in_g(x1)
U1_g(x1, x2) = U1_g(x2)
g_in_g(x1) = g_in_g(x1)
s(x1) = s(x1)
U3_g(x1, x2) = U3_g(x2)
U2_g(x1, x2) = U2_g(x2)
f_out_g(x1) = f_out_g
g_out_g(x1) = g_out_g
U2_G(x1, x2) = U2_G(x2)
F_IN_G(x1) = F_IN_G(x1)
U1_G(x1, x2) = U1_G(x2)
U3_G(x1, x2) = U3_G(x2)
G_IN_G(x1) = G_IN_G(x1)
We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 1 SCC with 3 less nodes.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
Pi DP problem:
The TRS P consists of the following rules:
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → F_IN_G(X)
F_IN_G(X) → G_IN_G(s(s(s(X))))
The TRS R consists of the following rules:
f_in_g(X) → U1_g(X, g_in_g(s(s(s(X)))))
g_in_g(s(s(s(s(X))))) → U3_g(X, f_in_g(X))
f_in_g(s(X)) → U2_g(X, f_in_g(X))
U2_g(X, f_out_g(X)) → f_out_g(s(X))
U3_g(X, f_out_g(X)) → g_out_g(s(s(s(s(X)))))
U1_g(X, g_out_g(s(s(s(X))))) → f_out_g(X)
The argument filtering Pi contains the following mapping:
f_in_g(x1) = f_in_g(x1)
U1_g(x1, x2) = U1_g(x2)
g_in_g(x1) = g_in_g(x1)
s(x1) = s(x1)
U3_g(x1, x2) = U3_g(x2)
U2_g(x1, x2) = U2_g(x2)
f_out_g(x1) = f_out_g
g_out_g(x1) = g_out_g
F_IN_G(x1) = F_IN_G(x1)
G_IN_G(x1) = G_IN_G(x1)
We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
Pi DP problem:
The TRS P consists of the following rules:
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → F_IN_G(X)
F_IN_G(X) → G_IN_G(s(s(s(X))))
R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ RFCMatchBoundsDPProof
Q DP problem:
The TRS P consists of the following rules:
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → F_IN_G(X)
F_IN_G(X) → G_IN_G(s(s(s(X))))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
Termination of the TRS P cup R can be shown by a matchbound [6,7] of 2. This implies finiteness of the given DP problem.
The following rules (P cup R) were used to construct the certificate:
G_IN_G(s(s(s(s(X))))) → F_IN_G(X)
F_IN_G(s(X)) → F_IN_G(X)
F_IN_G(X) → G_IN_G(s(s(s(X))))
The certificate found is represented by the following graph.
The certificate consists of the following enumerated nodes:
60, 61, 62, 64, 63, 65, 67, 66, 70, 69, 68
Node 60 is start node and node 61 is final node.
Those nodes are connect through the following edges:
- 60 to 61 labelled F_IN_G_1(0), F_IN_G_1(1)
- 60 to 62 labelled G_IN_G_1(0)
- 60 to 65 labelled G_IN_G_1(1)
- 60 to 68 labelled G_IN_G_1(2)
- 61 to 61 labelled #_1(0)
- 62 to 63 labelled s_1(0)
- 64 to 61 labelled s_1(0)
- 63 to 64 labelled s_1(0)
- 65 to 66 labelled s_1(1)
- 67 to 61 labelled s_1(1)
- 66 to 67 labelled s_1(1)
- 70 to 61 labelled s_1(2)
- 69 to 70 labelled s_1(2)
- 68 to 69 labelled s_1(2)